import { Component, EventEmitter, OnInit, Output } from '@angular/core';
import { MenuItem } from 'primeng/api';

@Component({
  selector: 'dws-graph-toolbar',
  templateUrl: './graph-toolbar.component.html',
  styleUrls: ['./graph-toolbar.component.scss']
})
export class GraphToolbarComponent implements OnInit {
  @Output()
  toolEvent = new EventEmitter<string>();
  tools: MenuItem[];
  constructor() { }

  ngOnInit(): void {
    this.tools = [
      {
        label: '', icon: 'pi pi-fw pi-search-plus', tooltipOptions: { tooltipLabel: 'ZoomIn Ctrl + ↑',
         tooltipStyleClass: 'tool-tip-style' }, command: (event: any) => {
          this.toolEvent.emit('zoomIn');
        }
      },
      {
        label: '', icon: 'pi pi-fw pi-search-minus', tooltipOptions: { tooltipLabel: 'ZoomOut Ctrl + ↓',
        tooltipStyleClass: 'tool-tip-style' }, command: (event: any) => {
          this.toolEvent.emit('zoomOut');
        }
      },
      {
        label: '', icon: 'pi pi-fw pi-replay', tooltipOptions: { tooltipLabel: 'Undo',
         tooltipStyleClass: 'tool-tip-style' }, command: (event: any) => {
          this.toolEvent.emit('undo');
        }
      },
      {
        label: '', icon: 'pi pi-fw pi-refresh', tooltipOptions: { tooltipLabel: 'Redo',
         tooltipStyleClass: 'tool-tip-style' }, command: (event: any) => {
          this.toolEvent.emit('redo');
        }
      }
    ];
  }

}


